*gfortran test1_u.f slasyf_rk.f -o test1_u -L /usr/local/lapacke/lib -lrefblas -llapack -ltmglib
      program Main
      EXTERNAL         SLASYF_RK
      EXTERNAL         PRINT_MATRIX, PRINT_INT_VECTOR


      CHARACTER        UPLO
      INTEGER          INFO, KB, LDA, LDW, N, NB,I,J
      PARAMETER        ( N = 10)
      PARAMETER        ( LDA = N, LDW = N )
      INTEGER          IPIV( LDA )
      REAL             A( LDA, LDA ), E( LDA ), W( LDW, LDW )
      REAL             AU( LDA, LDA )
      
      UPLO='U'
      INFO=N
      KB=8
      NB=8

      DATA             A/
     & -5.86, 3.99,-5.93,-2.82, 7.69, 9.3, 9.2, 5, 4, 1.5,
     & 0, 9.33,3.13,-8.02, 5.43, 1.2, 7.2, 3, 2.3, -1.3,
     & 0, 0,-5.22,-9.3,-5.59, 4.3, 2.2, 5.7, 4.9, -3.3,
     & 0, 0, 0,-2.82, 4.42, 4.3, 4.2, 5.11, -4.22, 2.5,
     & 0, 0, 0, 0, 6.22, 2.33, 6.2, 7.53, 8.42, 3.5,
     & 0, 0, 0, 0, 0, 1.3, 4.2, 5.3, -3.2, -1.5,
     & 0, 0, 0, 0, 0, 0, -9.2, 5.42, 4.78, 5.45,
     & 0, 0, 0, 0, 0, 0, 0, 5.99, 2.35, 7.55,
     & 0, 0, 0, 0, 0, 0, 0, 0, 3.2, 5.5,
     & 0, 0, 0, 0, 0, 0, 0, 0, 0, 6.65
     &                  /
     

      DO 20 I=1,LDA
            DO 40 J=1,LDA
            AU(I,J)=A(J,I)
40          CONTINUE
20    CONTINUE

*set IPIV , E and W
      DO 100 I= 1,10
            E(I)=2
            IPIV(I)=2
100   CONTINUE

      DO 200 I=1,LDW
            DO 150 J=1,LDW
                  W(I,J)=2
150         CONTINUE
200   CONTINUE

      CALL  SLASYF_RK(UPLO,N,NB,KB,AU,LDA,E,IPIV,W,LDW,INFO)

      CALL  PRINT_MATRIX('result A',N,N,AU,LDA)

      END program


*  =============================================================================
*
*     Auxiliary routine: printing a matrix.
*
      SUBROUTINE PRINT_MATRIX( DESC, M, N, A, LDA )
      CHARACTER*(*)    DESC
      INTEGER          M, N, LDA
      REAL             A( LDA, * )
*
      INTEGER          I, J
*
      WRITE(*,*)
      WRITE(*,*) DESC
      DO I = 1, M
         WRITE(*,9998) ( A( I, J ), J = 1, N )
      END DO
*
 9998 FORMAT( 11(:,1X,F6.2) )
      RETURN
      END
